package com.hzh.scala

object Demo5Fun {
  /**
   * 阶乘
   *
   */
  def main(args: Array[String]): Unit = {
    println(jieCheng(5))
  }

  def jieCheng(i:Int):Int={
    if(i==1){
      1
    }else{
      i*jieCheng(i-1)
    }
  }
}
